#ifndef	_GLOBAL_H_
#define	_GLOBAL_H_

#include <sc.h>
#include <string.h>

#define  unchar     unsigned char 
#define  unint        unsigned int
#define  unlong     unsigned long
typedef	unsigned char	uint8;
#define uchar unsigned char
#define INT8U   uint8
#define uint8_t         uint8
#define u8				uint8
#define U8				uint8
typedef	volatile unsigned char vuint8;
typedef	char			int8;
typedef	volatile char	vint8;
typedef	unsigned int	uint16;
#define uint16_t        uint16
#define u16				uint16
#define U16				uint16
typedef	volatile unsigned int	vuint16;
typedef	int				int16;
typedef volatile int	vint16;
typedef unsigned long   uint32;
#define u32				uint32
#define U32				uint32

typedef unsigned char	BOOL;

#define 	FALSE	0
#define		TRUE	1		

#define		YES		1
#define		NO		0

#define		HIGH	1
#define		LOW		0

#define		NULL	0

#ifdef	_GLOBAL_VAR_
#define	EXTERN
#else
#define	EXTERN	extern
#endif

#ifndef _XTAL_FREQ
 #define _XTAL_FREQ 16000000			//8Mhz
#endif

#define CLRWDT()	asm("clrwdt")
#define GCC_CLRWDT()  asm("clrwdt")
#define GCC_DELAY   _delay
#define __NOP()	asm("nop")

EXTERN bit F_TimeBase10ms;
EXTERN uint8 g_nSysTickCount1ms;
EXTERN uint8 g_nSysTickCount10ms;

#define _DEBUG_EN_ 0

#endif